//
//  ConsultationViewController.h
//  Cabinet
//
//  Created by Florent Montsegur on 03/07/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Consultation.h"
#import "Person.h"
#import "IEnregistrerNotifiable.h"


@interface ConsultationViewController : NSWindowController<NSTextViewDelegate,NSWindowDelegate> {
@private
    NSTableView *__unsafe_unretained mConsultations;
    
    NSTextField *__unsafe_unretained mConsDay;
    NSTextField *__unsafe_unretained mConsNum;
    NSDatePicker *__unsafe_unretained mConsDate;
    NSTextField *__unsafe_unretained mConsNom;
    NSTextField *__unsafe_unretained mConsPrenom;
    NSTextField *__unsafe_unretained mConsDiag;
    NSTextField *__unsafe_unretained mConsRef;
    NSTextView *__unsafe_unretained mConsTraitement;
    NSTextField *__unsafe_unretained mConsMoyenPaiement;
    NSTextField *__unsafe_unretained mConsActe;
    NSTextField *__unsafe_unretained mConsSomme;
    
    NSButton *__unsafe_unretained mConsPaye;
    NSButton *__unsafe_unretained mRenouvellement;
    
    NSButton *__unsafe_unretained mEnregistrer;
    
    NSDatePicker *__unsafe_unretained mNaissance;
    NSButton *__unsafe_unretained mTraitantMe;
    NSTextField *__unsafe_unretained mAge;
    
    NSButtonCell *__unsafe_unretained mFeuilleNone;
    NSButtonCell *__unsafe_unretained mFeuilleDone;
    NSButtonCell *__unsafe_unretained mFeuilleGiven;    
    
    Consultation* mConsultation;
    id<IEnregistrerNotifiable> mIEnregistrerNotifiable;
    int mResult;

}

@property (unsafe_unretained) IBOutlet NSTableView *mConsultations;

@property (unsafe_unretained) IBOutlet NSTextField *mConsDay;
@property (unsafe_unretained) IBOutlet NSTextField *mConsNum;
@property (unsafe_unretained) IBOutlet NSDatePicker *mConsDate;
@property (unsafe_unretained) IBOutlet NSTextField *mConsNom;
@property (unsafe_unretained) IBOutlet NSTextField *mConsPrenom;
@property (unsafe_unretained) IBOutlet NSTextField *mConsDiag;
@property (unsafe_unretained) IBOutlet NSTextField *mConsRef;
@property (unsafe_unretained) IBOutlet NSTextView *mConsTraitement;
@property (unsafe_unretained) IBOutlet NSTextField *mConsMoyenPaiement;
@property (unsafe_unretained) IBOutlet NSTextField *mConsActe;
@property (unsafe_unretained) IBOutlet NSTextField *mConsSomme;

@property (unsafe_unretained) IBOutlet NSButton *mConsPaye;
@property (unsafe_unretained) IBOutlet NSButton *mRenouvellement;
@property (unsafe_unretained) IBOutlet NSButton *mEnregistrer;

@property (unsafe_unretained) IBOutlet NSDatePicker *mNaissance;
@property (unsafe_unretained) IBOutlet NSButton *mTraitantMe;
@property (unsafe_unretained) IBOutlet NSTextField *mAge;

@property (unsafe_unretained) IBOutlet NSButtonCell *mFeuilleNone;
@property (unsafe_unretained) IBOutlet NSButtonCell *mFeuilleDone;
@property (unsafe_unretained) IBOutlet NSButtonCell *mFeuilleGiven;

// NSTextViewDelegate
- (BOOL)textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector;

- (IBAction)chequeAction:sender;
- (IBAction)especesAction:sender;
- (IBAction)aldAction:sender;
- (IBAction)cmuAction:sender;
- (IBAction)atAction:sender;
- (IBAction)artAction:sender;

- (IBAction)okAction:sender;
- (IBAction)annulerAction:sender;

- (void) closeWindow;
- (int) returnCode;


- (void)setConsultation:(Consultation*)aConsultation;
- (void) showConsultation:(Consultation*)aConsultation;
- (void) showPerson:(Person*)aPerson;
- (NSInteger)calculAge:(NSDate *)aNaissance;
- (void) fillConsultation:(Consultation*)aConsultation;
- (void) setIEnregistrerNotifiable: aIEnregistrerNotifiable;

@end
